/**
 * Copyright 2007 Andrea Agili <agea@users.sf.net>
 * 
 * This plugin is licensed under the Eclipse Public License:
 * http://www.eclipse.org/org/documents/epl-v10.php
 * 
 */

package net.sf.abseep.rcp;

import org.eclipse.swt.graphics.Point;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchAdvisor;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;

public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {

	private static final String PERSPECTIVE_ID = "SecureEditorRCP.perspective";

	public ApplicationWorkbenchAdvisor() {
	}

	@Override
	public String getInitialWindowPerspectiveId() {
		return PERSPECTIVE_ID;
	}

	public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
			IWorkbenchWindowConfigurer configurer) {
		return new WorkbenchWindowAdvisor(configurer) {
			public void preWindowOpen() {
				super.preWindowOpen();
				getWindowConfigurer().setInitialSize(new Point(600, 450));
				getWindowConfigurer().setShowCoolBar(true);
				getWindowConfigurer().setShowStatusLine(false);
			}

			public ActionBarAdvisor createActionBarAdvisor(
					IActionBarConfigurer abConfigurer) {
				return new ApplicationActionBarAdvisor(abConfigurer);
			}
		};
	}
}
